﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Idte.HumanResource.Core
{
    public class Name<TParent> : Name
    {
        [ForeignKey("ParentId")]
        public TParent Parent { get; set; }
        public int ParentId { get; set; }
    }
    public class Name
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid SysId { get; set; }
        public string DisplayName { get; set; }
        public string FullName { get; set; }
        [MaxLength(30)]
        public string FirstName { get; set; }
        [MaxLength(30)]
        public string MiddleName { get; set; }
        [MaxLength(30)]
        public string LastName {get; set;}
        public string Prefix { get; set; }
        public string Suffix { get; set; }

        public string Title { get; set; }
        public DateTime? Effective { get; set; }

        [ForeignKey("OwnerId")]
        public Person Owner { get; set; }
        public Guid? OwnerId { get; set; }
    }
}
